# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => 'c119062a5737a44be7deaa0f54d42f2c'

  include WikiSubdomains
  include AuthenticatedSystem
  before_filter :check_wiki_status
  
  protected
  
  def check_wiki_status
    unless wiki_subdomain == default_wiki_subdomain
      redirect_to default_wiki_url if current_wiki.nil?
    end
  end
end